Side-effect localization for lazy, purely functional languages via aspects

نویسندگان

  • Kung Chen
  • Shu-Chun Weng
  • Jia-Yin Lin
  • Meng Wang
  • Siau-Cheng Khoo
چکیده

Many side-effecting programming activities, such as profiling and tracing, can be formulated as crosscutting concerns and be framed as side-effecting aspects in the aspect-oriented programming paradigm. The benefit gained from this separation of concerns is particularly evident in purely functional programming, as adding such aspects using techniques such as monadification will generally lead to crosscutting changes. This paper presents an approach to provide side-effecting aspects for lazy purely functional languages in a user transparent fashion. We propose a simple yet direct state manipulation construct for developing side-effecting aspects and devise a systematic monadification scheme to translate the woven code to a monadic style purely functional code. Furthermore, we present a static and dynamic semantics of the aspect programs and reason about the correctness of our monadification scheme with respect to them.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Purely Functional Monadic Scheme

This paper describes a purely functional dialect of the algorithmic programming language Scheme. Mutable variables, assignment operations and impure control operations (call-with-current-continuation) have been omitted, while side effecting input and output operations are incorporated into the purely functional language using monads, similar to the approach taken in the lazy programming languag...

متن کامل

From Functional Logic Programs to Purely Functional Programs Preserving Laziness

Functional logic languages extend the setting of functional programming by non-deterministic choices, free variables and narrowing. Most existing approaches to simulate logic features in functional languages do not preserve laziness, i.e., they can only model strict logic programming like in Prolog. Lazy functional logic programming however, has interesting properties supporting a more declarat...

متن کامل

Lazy Algorithmic Debugging: Ideas for Practical Implementation

Lazy functional languages have non-strict semantics and are purely declarative, i.e. they support the notion of referential transparency and are devoid of side effects. Traditional debugging techniques are, however, not suited for lazy functional languages since computations generally do not take place in the order one might expect. Since algorithmic debugging allows the user to concentrate on ...

متن کامل

The Ins and Outs of Clean I/O

Functional programming languages have banned assignment because of its undesirable properties. The reward of this rigorous decision is that functional programming languages are side-effect free. There is another side to the coin: because assignment plays a crucial role in Input/Output (I/O), functional languages have a hard time dealing with I/O. Functional programming languages have therefore ...

متن کامل

Assignments for Applicative Languages

We propose a theoretical framework for adding assignments and dynamic data to functional languages without violating their semantic properties. This differs from semi-functional languages like Scheme and ML in that values of expressions remain static and side-effect-free. A new form of abstraction called observer is designed to encapsulate state-oriented computation from the remaining purely ap...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • Higher-Order and Symbolic Computation

دوره 24  شماره 

صفحات  -

تاریخ انتشار 2011